﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace D.Medicalcare.Infrastructure.Interfaces
{
    public interface IBaseRepository<T> where T : class, new()
    {
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="entity">参数</param>
        /// <returns></returns>
        Task<int> AddAsync(T entity);
        /// <summary>
        /// 批量新增
        /// </summary>
        /// <param name="entities">参数</param>
        /// <returns></returns>
        Task<int> AddRangeAsync(List<T> entities);
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="entity">参数</param>
        /// <returns></returns>
        Task<int> Update(T entity);
        /// <summary>
        /// 获取所有记录
        /// </summary>
        /// <returns></returns>
        IQueryable<T> GetAll();
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <returns></returns>
        Task<int> DelRange(List<T> t);

        Task<int> UpdateRang(IEnumerable<T> entities);
      

        Task<T> GetModel(int t);


    }
}
